<script language="JavaScript">

  /*  function ajaxfunction(page){
       if(page.length==0){
            return;
        }
        var xmlHttp;
        try{
            //FF Opear 8.0+ Safair
            xmlHttp=new XMLHttpRequest();
        }
        catch(e){
            try{
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch(e){
                alert("您的浏览器不支持AJAX");
                return false;    
            }
        }
        xmlHttp.onreadystatechange=function(){
            if(xmlHttp.readyState==4){
                document.getElementById("Excelinfo").innerHTML=xmlHttp.responseText;
            }
        }
	
        var url="{:U('Member/fenye',array('pd'=>'2','sid'=>'"+Math.random()+"'))}";
       
        url+='&page='+page;
        xmlHttp.open("GET",url,true);
        xmlHttp.send(null);
		
		
            
    }*/
  
</script>
<style type="text/css">

td{
text-align:center;
	font-size: 9pt;
    margin: -5px;
	word-break:keep-all; /* for ie */  
white-space:nowrap;
}
/*.inputlwn{*/
  /*box-sizing: border-box;*/
  /*text-align:center;*/
  /*font-size:2;*/
  /*height:6;*/
  /*border-radius:2px;*/
  /*border:1px solid #c8cccf;*/
  /*color:#6a6f77;*/
  /*-web-kit-appearance:none;*/
  /*-moz-appearance: none;*/
  /*margin-right:15px;*/
  /*outline:0;*/
  /*padding:0;*/
  /*text-decoration:none;*/
  /*width:50px;*/
/*}*/
.form-cont {
    /*display: block;*/
    /* width: 100%; */
    height: 34px;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.42857143;
    color: #555;
    background-color: #fff;
    background-image: none;
    border: 1px solid #ccc;
    border-radius: 4px;
    -webkit-box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
    box-shadow: inset 0 1px 1px rgba(0,0,0,.075);
    -webkit-transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
    transition: border-color ease-in-out .15s,box-shadow ease-in-out .15s;
    box-shadow: none;
}
.file {
    position: relative;
    display: inline-block;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 4px 12px;
    overflow: hidden;
    color: #333;
    text-decoration: none;
    text-indent: 0;
    line-height: 20px;
}
.file input {
    position: absolute;
    font-size: 100px;
    right: 0;
    top: 0;
    opacity: 0;
}
.file:hover {
    border-color: #ccc;
    text-decoration: none;
}
</style>

<eq name="requestfirst" value="1">
    <input type="hidden" id="requestfirst" value="1">
</eq>
<style>
.form-pure{width:100%;border: none;outline: none;color: #6dc4a2;padding: 5px 0; background:none;}
.panel-invite h5{ margin-bottom:15px;}
</style>
<div class="panel-invite">
    <div>
        <form action="{:U('Member/ExcelToSql','page=1')}" method='POST' target='iframe' enctype='multipart/form-data' id="fileform"><!-- 通过tartget设置表单提交后跳转的地方-->
            <div style="padding-top:15px;padding-bottom:15px">
                <a href="javascript:;" class="file">导入员工信息
                    <input   id="file" name="file_stu" type="file" style="float:left" onchange="document.getElementById('fileform').submit();">
                </a>
                <!--<input  type="file" name="file_stu" style="float:left" />-->
                <!--<input style="float:left" id="ajaxSubmit" type="submit" value="提交">-->
                <div class="clearfix"></div>
            </div>
            <div><a href="{:U('Member/Dowtem')}">下载模板</a></div>
        </form>
       <div  class="text-muted" style="padding-top:10px;line-height:30px">请点击上面按钮上传Excel文件 。</div>
       <div  class="text-muted" style="line-height: 30px;"> 注意事项:一次导入的人数不能大于50人,部门必须为贵公司已设定的部门。</div>
       <div  class="text-muted" style="line-height: 30px;">请勿修改模板，按照模板的格式进行输入即可,文件不能以中文命名。每次导入完成后，请重新点击该页面。
       </div>
       <div  class="text-muted" style="line-height: 30px;">导入的员工的账号为他的手机号，初始密码为123456，不要上传模板以外的表格，若上传后对比发现数据有误，可直接在页面上修改。</div>
        <hr style="width:auto"/>
        <iframe name='iframe' width='0px' height='0px' frameborder='0'></iframe><!-- 将iframe的高宽，边框都设置为0，相当于隐藏了-->
	    <form id='Expost' style=" width:100%;"  action="{:U('Member/export')}" method="post" class='checkoutform'>
            <div id='Excelinfo'> <input type="hidden" id="where" value="1"></div>
           
        </form>
      
     </div>
       {$submitbtn}
</div>
<link rel="stylesheet" type="text/css" href="__PUBLIC__/Intesys/AdminX/js/fuelux/css/tree-style.css"/>
<script src="__PUBLIC__/Intesys/AdminX/js/fuelux/js/tree.min.js"></script>
<script>
/*    $("#Expost").niceScroll({styler:"fb",cursorcolor:"#65cea7", cursorwidth: '5', cursorborderradius: '0px', background: '#424f63', spacebarenabled:false, cursorborder: '0'});
    $('.checkoutform').Validform({
        ajaxPost:true,
        tiptype:function(msg, s, data){
      
			if(s.type == 1){
//                $.ThinkBox.success('正在处理，请稍等……',{'delayClose':0,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
            }
            if(s.type == 3){
                $.ThinkBox.error(msg,{'delayClose':2000,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
            }
        },
        datatype:{
            "text":function(gets,obj,curform,regxp){
                return true;
            },"image":function(gets,obj,curform,regxp){
                return true;
            }
        },
        callback:function(data){
            if(data.status == 0){
                //	$.ThinkBox.error(data.info,{'delayClose':1000});
            }else{
                $.ThinkBox.success('操作成功',{'delayClose':2000,modal:false, 'close': '关闭',x:0,y:0,center:false,locate:['left','top'], show:['',0]});
            }
			
		
    });*/
	
	
	
	

		
		
		
    $("#export_button").click(function(){
		
		
		var fm = document.getElementById('Expost');
		var formdata=new FormData(fm);
		var xmlHttp;
        try{
            //FF Opear 8.0+ Safair
            xmlHttp=new XMLHttpRequest();
        }
        catch(e){
            try{
                xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
            }
            catch(e){
                alert("您的浏览器不支持AJAX");
                return false;    
            }
        }
        xmlHttp.onreadystatechange=function(){
            if(xmlHttp.readyState==4){
                document.getElementById("Excelinfo").innerHTML=xmlHttp.responseText;
            }
        }
	
        var url="{:U('Member/export')}";
       
      if(formdata!=null){
        xmlHttp.open("post",url,true);

        xmlHttp.send(formdata);
	  }
    });
	
	
	
	 
</script>